<template>
    <div class="child">
        <h2>子组件</h2>
        <h5>{{ toy }}</h5>
        <h5>父级给的元素：{{ che }}</h5>
        <button @click="sendToy(toy)">发送玩具</button>
    </div>
</template>

<script setup lang="ts">  
import { ref } from 'vue';
let toy = ref("小小标题")
defineProps(['che', 'sendToy']);
</script>
<style scoped>
.child {
    padding: 20px;
    background-color: skyblue;
    border: 1px solid #ccc;
    border-radius: 4px;
}
</style>